﻿using System;
using FU.Capstones.IMS.Web.Common;
using FU.Capstones.IMS.Web.Common.InventoryServiceProxy.DataContracts;
using FU.Capstones.IMS.Web.Common.InventoryServiceProxy.EventArgs;

namespace FU.Capstones.IMS.Web.Silverlight.Models
{
    public class AddListModel : ModelBase
    {
        //public event EventHandler<SingleFeedbackCompletedEventArgs<int>> InsertContactCompleted;

        public AddListModel()
        {
            client.GetMaterialCollectionTypeCompleted += DoGetMaterialCollectionTypeCompleted;
            //client.InsertContactCompleted += DoAddContactCompleted;
        }

        #region GetMaterialCollection

        public event EventHandler<CollectionFeedbackCompletedEventArgs<Material>> GetMaterialCollectionTypeCompleted;

        public int GetMaterialCollectionTypeAsync(bool isShowAll)
        {
            client.GetMaterialCollectionTypeAsync(isShowAll);
            return WebConstants.MagicNumer;
        }

        void DoGetMaterialCollectionTypeCompleted(object sender, CollectionFeedbackCompletedEventArgs<Material> e)
        {
            if (GetMaterialCollectionTypeCompleted != null)
            {
                GetMaterialCollectionTypeCompleted(sender, e);
            }
        }

        #endregion

        
    }
}
